package com.example.validproject.entity;

import com.example.validproject.valid.UpdateGroup;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * @author kh
 * Created by on  2021-09-27 11:22
 */
@Data
public class User {

    @NotNull(message = "业务主键不能为空", groups = UpdateGroup.class)
    private Long id;

    @Size(max = 10, message = "名字不能超过10个字符")
    @NotBlank(message = "名字不能为空")
    private String name;

    @NotNull(message = "年龄不能为空")
    private Integer age;

}
